package com.huanwei.me_question.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.huanwei.cc.R;
import com.huanwei.cc.base.Base_Z_Adapter;
import com.huanwei.cc.base.MyApplication;
import com.huanwei.cc.bean.ChengJi;
import com.huanwei.cc.bean.WDqd;


/**
 * Created by 他的猫 on 2016/12/3.
 * 我的went适配器
 */

public class QD_Adapter extends Base_Z_Adapter {
    QD_Adapter.Holder holder;


    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        // 查找控件
        if (null == convertView) {
            convertView = LayoutInflater.from(MyApplication.getInstance())
                    .inflate(R.layout.item_qiandao, null);
            holder = new QD_Adapter.Holder();
            holder.kemu = (TextView) convertView
                    .findViewById(R.id.kemu);
            holder.name = (TextView) convertView
                    .findViewById(R.id.name);
            holder.xuehao = (TextView) convertView
                    .findViewById(R.id.xuehao);

            holder.laoshiname = (TextView) convertView
                    .findViewById(R.id.laoshiname);
            holder.time = (TextView) convertView
                    .findViewById(R.id.time);
            holder.shijianduan = (TextView) convertView
                    .findViewById(R.id.shijianduan);
            holder.dizhi = (TextView) convertView
                    .findViewById(R.id.dizhi);
            // 缓存Holder
            convertView.setTag(holder);
        } else {
            holder = (QD_Adapter.Holder) convertView.getTag();
        }
        WDqd.RowsBean teacher = (WDqd.RowsBean) mDataList.get(position);

        holder.kemu.setText("嫌疑人名称：" + teacher.getUserNm());
        holder.name.setText("性别：" + teacher.getGender());
        holder.laoshiname.setText("年龄：" + teacher.getAge());

        holder.xuehao.setText("电话：" + teacher.getTelephone());
        holder.shijianduan.setText("地区：" + teacher.getFactoryAddr());
        holder.dizhi.setText("身份证："+teacher.getUser_account());
        holder.time.setVisibility(View.GONE);
        return convertView;
    }

    public class Holder {
        TextView kemu;
        TextView name;
        TextView xuehao;
        TextView laoshiname, time, shijianduan, dizhi;

        LinearLayout me_fragment_Fans;
    }


}
